<template>
    <ZZDialog class="settings" title="打印" @close="callbackClose()">
        <div class="center">
            <el-button type="primary" @click="saveas()" round>另存</el-button>
            <el-button type="primary" @click="prints()" round>打印</el-button>
        </div>
    </ZZDialog>
</template>

<script>

import ZZDialog from '../../../common/ZZDialog.vue';
import { Loading } from 'element-ui'
export default{
    components:{
        ZZDialog
    },
    data(){
        return{
            viewer:undefined,
            loading:null,

        }
    },
    beforeMount(){
        this.viewer = this.$store.state.viewer
    },
    mounted() {
        // this.getbookmark();
    },
    methods:{
        saveas() {
            this.loading = Loading.service({
                lock: true,
                text: '正在导出',
                background: 'rgba(0, 0, 0, 0.7)',
            })
            this.viewer.zz.expImage();
            this.loading.close()
        },
         prints () {
            this.loading = Loading.service({
                lock: true,
                text: '正在打印',
                background: 'rgba(0, 0, 0, 0.7)',
            })
            window.print();
            this.loading.close()
        },
        callbackClose(){
            this.$emit('close') 
        }
    }
}
</script > 
<style scoped>
.settings {
    position: absolute;
    top: 100px;
    right: 200px;
    height: 100px;
    width: 200px;
}
.center{
    display: flex;
    justify-content: center;
    padding: 10px;
}
</style>